package com.work.music.controller;

import com.work.music.common.ResponseJson;
import com.work.music.exception.AjaxOperationFailException;
import com.work.music.service.MusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by xs on 2019/4/14.
 */
@RestController
@RequestMapping("/app/music")
public class MusicController extends BaseController {
    @Autowired
    private MusicService musicService;

    /**
     * 添加歌手
     * @return
     */
    @RequestMapping("/addSongster")
    public ResponseJson addSongster() throws AjaxOperationFailException {
        return musicService.addSongster();
    }

    /**
     * 获取用户歌手列表信息
     * @return
     */
    @RequestMapping("/getSongsterList")
    public ResponseJson getSongsterList() {
        return musicService.getSongsterList();
    }

    /**
     * 添加专辑
     * @return
     */
    @RequestMapping("/addAlbum")
    public ResponseJson addAlbum() throws AjaxOperationFailException {
        return musicService.addAlbum();
    }

    /**
     * 获取用户专辑列表信息
     * @return
     */
    @RequestMapping("/getAlbumList")
    public ResponseJson getAlbumList() {
        return musicService.getAlbumList();
    }

    /**
     * 添加歌词
     * @return
     */
    @RequestMapping("/addLyrics")
    public ResponseJson addLyrics() throws AjaxOperationFailException {
        return musicService.addLyrics();
    }

    /**
     * 编辑歌手信息
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/editSongster")
    public ResponseJson editSongster() throws AjaxOperationFailException {
        return musicService.editSongster();
    }

    /**
     * 编辑专辑
     * @return
     */
    @RequestMapping("/editAlbum")
    public ResponseJson editAlbum() throws AjaxOperationFailException {
        return musicService.editAlbum();
    }

    /**
     * 编辑歌词
     * @return
     */
    @RequestMapping("/editLyrics")
    public ResponseJson editLyrics() throws AjaxOperationFailException {
        return musicService.editLyrics();
    }

    /**
     * 搜索
     * @return
     */
    @RequestMapping("/getSearchInfo")
    public ResponseJson getSearchInfo() {
        return musicService.getSearchInfo();
    }

    /**
     * 获取首页信息
     * @return
     */
    @RequestMapping("/getHomePage")
    public ResponseJson getHomePage() throws AjaxOperationFailException {
        return musicService.getHomePage(0);
    }

    /**
     * 点赞
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/musicPraise")
    public ResponseJson musicPraise() throws AjaxOperationFailException {
        return musicService.musicPraiseCollect(0);
    }

    /**
     * 收藏
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/musicCollect")
    public ResponseJson musicCollect() throws AjaxOperationFailException {
        return musicService.musicPraiseCollect(1);
    }

    /**
     * 关注
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/musicConcern")
    public ResponseJson musicConcern() throws AjaxOperationFailException {
        return musicService.musicPraiseCollect(2);
    }

    /**
     * 获取歌词详情
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/getLyricsById")
    public ResponseJson getLyricsById() throws AjaxOperationFailException {
        return musicService.getLyricsById();
    }

    /**
     * 获取我的收藏
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/getCollect")
    public ResponseJson getCollect() throws AjaxOperationFailException {
        return musicService.getCollect();
    }

    /**
     * 添加评论及回复
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/addcomment")
    public ResponseJson addComment() throws AjaxOperationFailException {
        return musicService.addComment();
    }

    /**
     * 获取评论列表信息
     * @return
     */
    @RequestMapping("/getComment")
    public ResponseJson getComment() throws AjaxOperationFailException {
        return musicService.getComment();
    }

    /**
     * 获取歌手详情
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/getSongsterInfo")
    public ResponseJson getSongsterInfo() throws AjaxOperationFailException {
        return musicService.getSongsterInfo();
    }

    /**
     * 根据歌手id和歌曲类型获取歌曲列表信息
     * @return
     */
    @RequestMapping("/getLyricsBySongsterIdAndType")
    public ResponseJson getLyricsBySongsterIdAndType() throws AjaxOperationFailException {
        return musicService.getHomePage(1);
    }

    /**
     * 根据专辑id获取歌曲列表信息
     * @return
     */
    @RequestMapping("/getLyricsByAlbumId")
    public ResponseJson getLyricsByAlbumId() throws AjaxOperationFailException {
        return musicService.getHomePage(2);
    }

    /**
     * 获取收藏歌曲列表信息
     * @return
     */
    @RequestMapping("/getCollectLyrics")
    public ResponseJson getCollectLyrics() throws AjaxOperationFailException {
        return musicService.getHomePage(3);
    }

    /**
     * 获取专辑详情
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/getAlbumInfo")
    public ResponseJson getAlbumInfo() throws AjaxOperationFailException {
        return musicService.getAlbumInfo();
    }

    /**
     * 添加意见反馈
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/addFeedback")
    public ResponseJson addFeedback() throws AjaxOperationFailException {
        return musicService.addFeedback();
    }

    /**
     * 歌曲纠错
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/addLyricsError")
    public ResponseJson addLyricsError() throws AjaxOperationFailException {
        return musicService.addLyricsError();
    }

    /**
     * 删除评论
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/removeComment")
    public ResponseJson removeComment() throws AjaxOperationFailException {
        return musicService.removeComment();
    }

    /**
     * 举报
     * @return
     */
    @RequestMapping("/addReport")
    public ResponseJson addReport() throws AjaxOperationFailException {
        return musicService.addReport();
    }

    /**
     * 根据单词获取单词详情
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/getWordInfoByName")
    public ResponseJson getWordInfoByName() throws AjaxOperationFailException {
        return musicService.getWordInfoByName();
    }

    /**
     * 根据单词获取单词详情
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/getWordIsHaveByTargetWord")
    public ResponseJson getWordIsHaveByTargetWord() throws AjaxOperationFailException {
        return musicService.getWordIsHaveByTargetWord();
    }

    /**
     * 添加单词
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/addWord")
    public ResponseJson addWord() throws AjaxOperationFailException{
        return musicService.addWord();
    }

    /**
     * 根据单词获取单词库
     * @return
     */
    @RequestMapping("/getWordByName")
    public ResponseJson getWordByName() throws AjaxOperationFailException {
        return musicService.getWordByName();
    }

    /**
     * 获取单词库
     * @return
     */
    @RequestMapping("/getCollectWord")
    public ResponseJson getCollectWord(){
        return musicService.getWord();
    }

    /**
     * 获取广告积分类型
     * @return
     */
    @RequestMapping("/getIntegralType")
    public ResponseJson getIntegralType() {
        return musicService.getIntegralType();
    }

    /**
     * 看广告
     * @return
     */
    @RequestMapping("/lookAdvert")
    public ResponseJson lookAdvert() throws AjaxOperationFailException {
        return musicService.lookAdvert();
    }

    /**
     * 查询单词并扣除积分
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/getWordInfo")
    public ResponseJson getWordInfo() throws AjaxOperationFailException {
        return musicService.getWordInfo();
    }

    /**
     * 获取用户积分记录
     * @return
     * @throws AjaxOperationFailException
     */
    @RequestMapping("/getIntegralLog")
    public ResponseJson getIntegralLog() {
        return musicService.getIntegralLog();
    }
}
